using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Windows.Forms;

namespace CreamXStudio.Classes
{
    public static class CreamXErrorHandler
    {
        static StreamWriter _stream;
        static CreamXErrorHandler()
        {
            if (!File.Exists("CreamXStudioLog.log"))
            {
                File.Create("CreamXStudioLog.log");
            }
            
        }
        

        public static void LogError(Exception err)
        {
            
            _stream = new StreamWriter("CreamXStudioLog.log");
            _stream.WriteLine("ERROR : " + err.ToString());
            _stream.Close();
        }
        public static void ShowError(Exception err, string message)
        {
            MessageBox.Show(message, "Error Occurred");
        }
    }
}
